/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 */
package com.star.modules.sys.entity;

import org.hibernate.validator.constraints.Length;

import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.mapper.query.QueryType;

/**
 * 在线留言Entity
 * @author L
 * @version 2018-09-03
 */
@Table(name="${_prefix}message", alias="a", columns={
		@Column(name="id", attrName="id", label="用户ID", isPK=true),
		@Column(name="name", attrName="name", label="姓名", queryType=QueryType.LIKE),
		@Column(name="phone", attrName="phone", label="手机/微信"),
		@Column(name="as_news", attrName="asNews", label="是否阅读"),
		@Column(includeEntity=DataEntity.class),
	}, orderBy="a.as_news,a.create_date"
)
public class ShMessage extends DataEntity<ShMessage> {
	
	private static final long serialVersionUID = 1L;
	private String name;		// 姓名
	private String phone;		// 手机/微信
	private Integer asNews;		// 是否阅读
	
	public ShMessage() {
		this(null);
	}

	public ShMessage(String id){
		super(id);
	}
	
	@Length(min=0, max=10, message="姓名长度不能超过 10 个字符")
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	
	@Length(min=0, max=20, message="手机/微信长度不能超过 20 个字符")
	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}
	
	public Integer getAsNews() {
		return asNews;
	}

	public void setAsNews(Integer asNews) {
		this.asNews = asNews;
	}
	
}